package cn.igroup.server.nio.conf;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author LONG
 * @date 2018/2/5 15:24
 */
@Component
@ConfigurationProperties("netty")
public class NioConfiguration {

    public String host = "127.0.0.1";
    public int port = 8000;
    public boolean useSecureSocketsLayer = false;
    public boolean useLinuxNativeEpoll = false;

    /**
     * 0 = current_processors_amount * 2
     */
    public int bossThreads = 0;
    public int workerThreads = 0;


    public boolean isUseSecureSocketsLayer() {
        return useSecureSocketsLayer;
    }

    public void setUseSecureSocketsLayer(boolean useSecureSocketsLayer) {
        this.useSecureSocketsLayer = useSecureSocketsLayer;
    }

    public boolean isUseLinuxNativeEpoll() {
        return useLinuxNativeEpoll;
    }

    public void setUseLinuxNativeEpoll(boolean useLinuxNativeEpoll) {
        this.useLinuxNativeEpoll = useLinuxNativeEpoll;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public Boolean getUseLinuxNativeEpoll() {
        return useLinuxNativeEpoll;
    }

    public void setUseLinuxNativeEpoll(Boolean useLinuxNativeEpoll) {
        this.useLinuxNativeEpoll = useLinuxNativeEpoll;
    }

    public int getBossThreads() {
        return bossThreads;
    }

    public void setBossThreads(int bossThreads) {
        this.bossThreads = bossThreads;
    }

    public int getWorkerThreads() {
        return workerThreads;
    }

    public void setWorkerThreads(int workerThreads) {
        this.workerThreads = workerThreads;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }
}
